
<%@page import="com.lovo.vo.TreeNode"%>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>

<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
TreeNode root = (TreeNode)request.getAttribute("root");
%>

<%!
	public String getsons(TreeNode root){
	String result = " ";
	if(root.getChildren().size()>0){
		result = result + "<ul>";
		for(TreeNode son:root.getChildren()){
			result = result+"<li>";
			result = result+"<a href=\"javascript:\" onclick=\"$.bringBack({deptid:'"+son.getId()+"',deptname:'"+son.getText()+"'})\"><span style='display:none'>"+son.getId()+"</span><span>"+son.getText()+"</span></a>";
			result = result + getsons(son);
			result = result+"</li>";
		}
		result = result + "</ul>";
	}
	return result;
	}

%>
<div style="float:left; display:block; margin:10px; overflow:auto; width:90%; height:80%; border:solid 1px #CCC; line-height:21px; background:#FFF;">

<ul class="tree treeFolder collapse" id="aul">
	<li><a href="javascript:void(0);" onclick="$.bringBack({deptid:'<%=root.getId()%>',deptname:'<%=root.getText()%>'})" ><span style='display:none'><%= root.getId()%></span><span><%= root.getText()%></span></a>
	<%
		out.write(getsons(root));
	%>
	</li>
</ul>
</div>
  